<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>正则表达式使用</title>
  </head>
  <body>
    <script>
      var reg = /abc/;
      console.log('测试1--', reg.test(123));
      console.log('测试2--', reg.test('ddabcdd')); // 只要包含 abc，就返回 true
    </script>
  </body>
</html>
